/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package damagecalculator;

import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLayeredPane;

/**
 *
 * @author Marcelo
 */
public class PreItemsButton extends JButton implements ActionListener {

    Container container;

    public PreItemsButton(Container c) {
        container = c;
        init();
    }

    private void init() {
        addActionListener(this);
    }

    public void actionPerformed(ActionEvent e) {
        JLayeredPane o = new JLayeredPane();
        DamageCalculatorView.ShopPanel.setLayer(DamageCalculatorView.ItemsPanelStore,
                o.getLayer(container) + 1);
        ButtonGrid.createGrid(this.getText(), DamageCalculatorView.ItemsPanelStore);
    }
}